package com.minimalist.common.entity.lindi.vo.news;

import com.minimalist.common.config.mybatis.bo.PageReq;
import com.minimalist.common.config.swagger.SchemaEnum;
import com.minimalist.common.entity.basic.enums.StatusEnum;
import com.minimalist.common.utils.Add;
import com.minimalist.common.utils.Update;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotNull;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author 11987
 */

@Schema(name = "林地指标交易平台_新闻查询实体")
public class LindiNewsQueryVO extends PageReq implements Serializable{
    @Serial
    private static final long serialVersionUID = 1L;

    @Schema(name = "noticeTitle", description = "新闻标题", type = "string")
    private String newsTitle;

    @NotNull(message = "新闻状态不能为空", groups = {Add.class, Update.class})
    @SchemaEnum(implementation = StatusEnum.class)
    @Schema(name = "status", description = "新闻状态", type = "string")
    private Integer status;

    public LindiNewsQueryVO(){
    }

    public String getNewsTitle(){
        return newsTitle;
    }

    public void setNewsTitle(String newsTitle){
        this.newsTitle = newsTitle;
    }

    public Integer getStatus(){
        return status;
    }

    public void setStatus(Integer status){
        this.status = status;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        if (!super.equals(o)){
            return false;
        }
        LindiNewsQueryVO that = (LindiNewsQueryVO) o;
        return Objects.equals(newsTitle, that.newsTitle) && Objects.equals(status, that.status);
    }

    @Override
    public int hashCode(){
        return Objects.hash(super.hashCode(), newsTitle, status);
    }
}
